int main()
{  	 	   		 
    int groupNum, currentNum,  coupon;
    int groupLevel = 0;
    float discount = 0;
    float cost = 0;

    scanf("%d,%d,%d", &groupNum, &currentNum, &coupon);  //1

    if (groupNum < 0 || currentNum <= 0)                 //1
    {  	 	   		 
        printf("Error");
        return 0;
    }

    if (coupon == 50 || coupon == 100 || coupon == 200)
    {  	 	   		 
        groupNum += currentNum;                           //1
        groupLevel = groupNum / 50;                       //1
        switch (groupLevel)                               //1
        {  	 	   		 
        case 0:                                      //1
            discount = 1.0;
            break;                                       //1
        case 1:
            discount = 0.9;
            break;
        default:                                     //1
            discount = 0.8;
            break;
        }
        cost = currentNum * 58 * discount - coupon / 10;  //1
        printf("cost=%.2f", cost);                        //1
    }
    else
    {  	 	   		 
        printf("Error");
    }
    return 0;
}